package oracle;

import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.sql.Connection;

import org.firefly.db.dialect.IDialect;
import org.firefly.db.dialect.OracleDialect;
import org.firefly.db.util.DBInfo;
import org.firefly.db.util.DBName;
import org.firefly.db.util.DBUtils;

public class Pro30001 {
	public static void main(String[] args) throws Exception {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		Connection srcConn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.5:1521:orcl", "PRO30001_B", "eplugger");
		try {
			DBInfo srcInfo = new DBInfo(srcConn, "PRO30001_B", DBName.Oracle);
			IDialect srcDia = new OracleDialect();
			FileOutputStream fos = new FileOutputStream("/Users/firefly/Desktop/cp.sql");
			OutputStreamWriter osw = new OutputStreamWriter(fos);
			DBUtils.expertInsertSQL(srcInfo, srcDia, osw, new String[]{"TMP_G_SK_ZJ","TMP_G_SK_XM","TMP_G_KJ_ZJ","TMP_G_KJ_XM"}, null, true);
		} finally{
			srcConn.close();
		}
	}
}
